package com.sneakxy.mybase4j.platform.beans;

import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotBlank;
import org.springframework.data.annotation.Id;

import com.sneakxy.mybase4j.base.bean.BaseEntity;
import com.sneakxy.mybase4j.base.bean.TimeEntity;
import com.sneakxy.mybase4j.base.bean.ValidAdd;
import com.sneakxy.mybase4j.base.bean.ValidEdit;
import com.sneakxy.mybase4j.shiro.bean.ShiroAccount;
import com.sneakxy.mybatis.commons.annotations.Column;
import com.sneakxy.mybatis.commons.annotations.Table;
import com.sneakxy.mybatis.commons.orm.generation.GeneratedValue;
import com.sneakxy.mybatis.commons.orm.generation.GenerationType;

/**
 * 账户表
 * @author 潜行的青衣
 * @see
 */
@Table("t_mb4j_account")
public class Account extends BaseEntity<String> implements TimeEntity, ShiroAccount {

	private final static long serialVersionUID = -1L;

	@Id
	@NotBlank(groups = {ValidEdit.class})
	@Size(max=32)
	@Column("id")
	@GeneratedValue(strategy = GenerationType.UUID)
	private String id;

	@NotBlank
	@Size(max=50)
	@Column("account")
	private String account;
	
	@NotBlank
	@Size(max=50)
	@Column("display_name")
	private String displayName;

	@NotBlank(groups = {ValidAdd.class})
	@Size(max=32)
	@Column("password")
	private String password;

	@Column("status")
	private int status;

	@Size(max=100)
	@Column("memo")
	private String memo;
	
	/**
	 * 拓展字典，所属关联，可以是用户ID等.
	 */
	@Column("owner")
	private String owner;

	@Column("createtime")
	private String createtime;

	@Column("updatetime")
	private String updatetime;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}
	
	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getCreatetime() {
		return createtime;
	}

	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}

	public String getUpdatetime() {
		return updatetime;
	}

	public void setUpdatetime(String updatetime) {
		this.updatetime = updatetime;
	}

}
